/*软件延时函数*/
void Delay(volatile int delay)
{
	while(delay --);
}
/*主函数*/
int main(void)
{
	/*定义指针指向寄存器地址*/
	unsigned int *pGPFCON	= (unsigned int *)0x56000050;
	unsigned int *pGPFDATA	= (unsigned int *)0x56000054;
	int val = 0;
	int tmp = 0;
	
	/*配置引脚*/
	*pGPFCON &= ~((3 << 8) | (3 << 10) | (3 << 12));	//清零
	*pGPFCON |= ((1 << 8) | (1 << 10) | (1 << 12));
	
	/*循环点亮*/
	while(1)
	{
		tmp = ~val;
		tmp &= 7;
		*pGPFDATA &= ~(7 << 4);
		*pGPFDATA |= ~(val << 4);
		val ++;
		Delay(100000);
		if(val == 8)
		{
			val = 0;
		}
	}
}
